identify = function() {
	var code = $('#accessCode').val();
	$.ajax({
		type : 'Post',
		contentType : 'application/json',
		url : '/qRH-WS/services/accessCode/identification',
		data : code,
	    dataType : 'json',
		success : function(result, textStatus, jqXHR) {
			console.log(result);
			if(result == true) {
				console.log('Identification succeeded');
				window.location.replace("admin/candidat.html");
			} else {
				alert('Le code saisi est incorrect !');
			}
		},
		error : function (xhr, ajaxOptions, thrownError){
            alert(xhr.status);
            alert(xhr.responseText);
        }
	});
};

retrieveAccessCode = function() {
	$.ajax({
		type : 'Get',
		url : '/qRH-WS/services/accessCode/getAccessCode',
	    dataType : 'json',
	    crossDomain : true,
		success : function(result, textStatus, jqXHR) {
			alert('Success');
			alert(result);
		},
		error : function (xhr, ajaxOptions, thrownError){
            alert(xhr.status);
            alert(xhr.responseText);
        } 
	});
};
